import request from '@/router/axios'

export function fetchList (query) {
  return request({
    url: '/api/manage/sysDict/page',
    method: 'get',
    params: query
  })
}

export function fetchItemList (query) {
  return request({
    url: '/api/manage/sysDict/item/page',
    method: 'get',
    params: query
  })
}

export function addItemObj (obj) {
  return request({
    url: '/api/manage/sysDict/item',
    method: 'post',
    data: obj
  })
}

export function getItemObj (id) {
  return request({
    url: '/api/manage/sysDict/item/' + id,
    method: 'get'
  })
}

export function delItemObj (id) {
  return request({
    url: '/api/manage/sysDict/item/' + id,
    method: 'delete'
  })
}

export function putItemObj (obj) {
  return request({
    url: '/api/manage/sysDict/item',
    method: 'put',
    data: obj
  })
}

export function addObj (obj) {
  return request({
    url: '/api/manage/sysDict',
    method: 'post',
    data: obj
  })
}

export function getObj (id) {
  return request({
    url: '/api/manage/sysDict/' + id,
    method: 'get'
  })
}

export function delObj (id) {
  return request({
    url: '/api/manage/sysDict/' + id,
    method: 'delete'
  })
}

export function putObj (obj) {
  return request({
    url: '/api/manage/sysDict/',
    method: 'put',
    data: obj
  })
}

export function remote (type) {
  return request({
    url: '/api/manage/sysDict/type/' + type,
    method: 'get'
  })
}
